﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ include file="/common/common.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/cases/report/";  //应用的地址名
String listActionName = basePath+"ReportTaxIllegal.action?op=searchjs";
String lookActionName = basePath+"ReportTaxIllegal.action?op=look";
String addActionName = basePath+"ReportTaxIllegal_add.action";
String editActionName = basePath+"ReportTaxIllegal_modify.action";
String delActionName = basePath+"ReportTaxIllegal_del.action?op=deljs";
String dealActionName=basePath+"ReportTaxIllegal_dealPage.action";
String replyActionName=basePath+"ReportTaxIllegal_replyPage.action";
String rewardActionName=basePath+"ReportTaxIllegal_rewardPage.action";
String excelActionName=basePath+"ReportTaxIllegal_saExcel.action";
String signActionName = basePath+"ReportTaxIllegal_dealSign.action";
String drawActionName = basePath+"ReportTaxIllegal_drawPage.action";
String publicActionName = basePath+"ReportTaxIllegal_publicReportTaxIllegal.action";
%>
<script language="javascript" src="<%=path %>/js/My97/WdatePicker.js"></script>
<script type="text/javascript" src="<%=path %>/js/fileupload.js"></script>
<script language="javascript" src="<%=path %>/jslib/orgSelect.js"></script>
<script type="text/javascript">
    		$(function(){
    			$('#regDept').combotree({
    			    url:'<%=path%>/util/util_searchOrgJsonTree.action?viewType=self&',
    			    params:{},
    			    valueField:'id',
    		        textField:'text',
    		        panelWidth:200,
    		        checkbox:false
    		        });
    			
    			$('#inspectDept').orgSelect({
    				inspectDeptId:'inspectDept',
    		        collectDeptId:'collectDept'
    			});
    			<%-- $('#inspectDept').combotree({
    			    url:'<%=path%>/util/util_searchOrgJsonTree.action?&',
    			    params:{},
    			    valueField:'id',
    		        textField:'text',
    		        panelWidth:200,
    		        checkbox:false
    		        }); --%>
			//表格初始化
			$('#searchTable').grid({
				title:[<ce:menu/>],
				url:'<%=listActionName%>',
				singleSelect:true,
				queryParams:{
					'search.regNumber':'',
					'search.repDept':'',
					'search.repType':'',
					'search.beginRepDate':'',
					'search.endRepDate':'',
					'search.repPerson':'',
					'search.repPersonPhone':'',
					'search._dealWay':'',
					'search.beginCloseDate':'',
					'search.endCloseDate':'',
					'search.regDept':'',
					'search.inspectDept':'',
					'search.collectDept':'',
					'search.directorPassFlag':''
					},  //用于查询的参数以及初始值
				//表头列，不建议改动
				frozenColumns:[[   
	                {field:'ck',checkbox:true},
	                {field:'reportTime',title:'检举日期',width:80,sortable:true},
                    {field:'directorPassFlag',title:'状态',width:50,sortable:true,
                    	formatter:function(value){
      						if(value=='1'){
        						return "已处理";
        					}else if(value=='2'){
        						return "不予处理";
        					}else{
        						return "未处理";
        					}
        				}},		
                    {field:'taxpayerNumber',title:'纳税人识别号',width:100,sortable:true},
                    {field:'taxEnterprice',title:'企业名称',width:160,sortable:true},
                    {field:'dealResult',title:'处理方式',width:60,
                        formatter:function(value){
          					if(value=='1'){
          					  return "快捷处理";
          					}else if(value=='2'){
          						return "移交市局";
          					}else if(value=='3'){
          						return "转交其他部门";
          					}else{
          						return "";
          					}
          				}
                      
                      },
                      {field:'evoke',title:'书面移交资料',width:60,
                          formatter:function(value){
            					if(value=='1'){
            					  return "有";
            					}else{
            						return "无";
            					}
            				}
                        
                        }
				]],
				//数据列，根据显示的内容进行修改
				columns:[[   
                        {field:'prosecutedPersonAddr',title:'被检举人地址',width:100},
                        {field:'reportTypeName',title:'检举形式',width:50,sortable:true},
                        {field:'reportFromName',title:'检举来源',width:50,sortable:true},
            			{field:'directorAdvice',title:'处理情况',width:100,sortable:true},
            			{field:'director',title:'经办人',width:80,sortable:true},
            			{field:'directorApprDate',title:'经办日期',width:80,sortable:true},
                        {field:'registerDept',title:'登记部门',width:100,sortable:true},
                        {field:'replyWay',title:'回复情况',width:240,
                            formatter:function(value){
              					if(value=='0'){
              					  return "未回复";
              					}else if(value=='1'){
              						return "已回复";
              					}else if(value=='2'){
              						return "未要求回复";
              					}else{
              						return "";
              					}
              				}
                          
                          },
                          {field:'rewardResult',title:'奖励情况',width:240}
                      
				]],
				//功能按钮组
                toolbar:[<ce:jsonBtn/>]
			});
			//查询操作
			$('#search').click(function(){
                defaultSearchAction();
            });
			$('#resetSearch').click(function(){
				$('#regNumber').val("");
			    $('#regDept').combotree('setValue','');
			    $('#repType').val("");
			    $('#beginRepDate').val("");
			    $('#endRepDate').val("");
			    $('#repPerson').val("");
			    $('#repPersonPhone').val("");
			    $('#_dealWay').val("");
			    $('#beginCloseDate').val("");
			    $('#endCloseDate').val("");
			    $('#repDept').val("");
			  			    
			  
			});
		});	
		
		//点击添加按钮后的操作：打开添加界面
        function openAddPage(){
            //默认的打开添加界面操作(添加页面地址，窗口宽度，窗口高度)
            defaultOpenAddPageHavebtn('<%=addActionName%>',700,550);
		}
		//点击编辑按钮后的操作：打开编辑界面
		function openModifyPage(){
		    //默认的打开编辑界面操作（编辑页面地址，窗口宽度，窗口高度）
            defaultOpenModifyPageHavebtn('<%=editActionName%>',700,550);
		}
		//删除数据操作
		function deleteItems(){
            defaultDeleteItems('<%=delActionName%>');
		}
		//打开查看页面
 		function viewItem(id){
 			var rows = $('#searchTable').datagrid('getSelections');	
 			var id=rows[0].vcId;
 			defaultOpenWindow('<%=lookActionName%>&chkSelf='+id,'举报信息查看',600,600)
 		}
		//点击帮助按钮后的操作：打开帮助界面
		function openHelpPage(){
		    defaultOpenWindow('<%=path%>/sys/menu/SysMenuHelp_look.action?chkSelf=<%=request.getAttribute("menuId").toString() %>','帮助信息查看',600,600);
		}
        function dealRegist(){
        	defaultOpenDealPageHavebtn('<%=dealActionName%>',580,300,null,'处理情况登记');
        }
        function submitRow(){
        	var rows = $('#searchTable').datagrid('getSelections');
        	if(rows.length>0){
        		if(rows.length>1){
        			$.messager.alert('消息提示','请选择单条记录！','error');
        			return false;
        		}else{
        			if(rows[0].dealResult=="2" || rows[0].state!="0"){
        				$.messager.alert('消息提示','该条检举记录不允许提请！<br/>原因：可能已提请或已签收，或者只能进行签收操作。','error');
        				return false;
        			}
        		}
        	}
        	defaultOpenDealPageHavebtn('<%=drawActionName%>',620,660,null,'检举案源提请');
        }
        function signItems(){
        	var rows = $('#searchTable').datagrid('getSelections');
        	if (rows.length>0){
        		for(var i=0;i<rows.length;i++){
        			if(rows[i].dealResult!="2" || rows[i].state!="0"){
        				$.messager.alert('消息提示','存在不允许签收的记录！<br/>原因：可能已提请或已签收','error');
        				return false;
        			}
        		}
        		$.messager.confirm('警告', '您确定要签收选择的记录吗?', function(r){
    				if (r){
    					  var ids = new Array();
    					  for(var i=0;i<rows.length;i++){
    						ids[i] = rows[i].vcId;
    					  }
    					 $.post('<%=signActionName%>',{chkSelf:ids},function(data){
    					    try{
    					            jsonReStr = jQuery.parseJSON(data);
    					            if(jsonReStr.opState=="success"){
    					            	$('div.datagrid-header-check input[type="checkbox"]').attr('checked',false);
    						            $.util.showTip({content:jsonReStr.opInfo});
    						            $('#searchTable').datagrid('reload');
    					            }else if(jsonReStr.opState=="failure"){
    					                $.messager.alert('消息提示','操作处理失败！原因如下：<br><font color=red>'+jsonReStr.opInfo+'</font>','error');
    					            }
    				            }catch(e){
    				            	msg = ''+e;
    				            	if(msg.length>280)msg = msg.substr(0,280)+'...';
    				               $.messager.alert('消息提示','出现系统错误!可能原因如下：<br><font color=red>'+this.url+'页面地址未找到！或'+msg+'</font>','error');
    				            }
    					 });
    				}
        		});
        	}else{
        		$.messager.alert('消息提示','请选择要签收的记录！','error');
        	}
        }
        //推送至征管局
        function publicReportTaxIllegal(){
        	var rows = $('#searchTable').datagrid('getSelections');
        	if (rows.length>0){
        		for(var i=0;i<rows.length;i++){
        			if( rows[i].state=="3"){
        				$.messager.alert('消息提示','已经推送相关征管局！','error');
        				return false;
        			}
        		}
        		$.messager.confirm('警告', '您确定要推送选择的记录吗?', function(r){
    				if (r){
    					  var ids = new Array();
    					  for(var i=0;i<rows.length;i++){
    						ids[i] = rows[i].vcId;
    					  }
    					 $.post('<%=publicActionName%>',{chkSelf:ids},function(data){
    					    try{
    					            jsonReStr = jQuery.parseJSON(data);
    					            if(jsonReStr.opState=="success"){
    					            	$('div.datagrid-header-check input[type="checkbox"]').attr('checked',false);
    						            $.util.showTip({content:jsonReStr.opInfo});
    						            $('#searchTable').datagrid('reload');
    					            }else if(jsonReStr.opState=="failure"){
    					                $.messager.alert('消息提示','操作处理失败！原因如下：<br><font color=red>'+jsonReStr.opInfo+'</font>','error');
    					            }
    				            }catch(e){
    				            	msg = ''+e;
    				            	if(msg.length>280)msg = msg.substr(0,280)+'...';
    				               $.messager.alert('消息提示','出现系统错误!可能原因如下：<br><font color=red>'+this.url+'页面地址未找到！或'+msg+'</font>','error');
    				            }
    					 });
    				}
        		});
        	}else{
        		$.messager.alert('消息提示','请选择要推送的记录！','error');
        	}
        }
        
       function saveAsExcel(){
    	   if($('#saveExcelFrm').length==0){
    			$('<iframe id="saveExcelFrm" name="saveExcelFrm" width=0 height=0></iframe>').appendTo(document.body);
    		}
    		var f = $('form:first');
    		var fa = f.attr('action');
    		f.attr('target','saveExcelFrm');
    		f.attr('action','<%=excelActionName%>');
    		f[0].submit();
    		f.attr('target','');
    		f.attr('action',fa);
        }  
</script>
<html>
 <head>
<title></title>
</head> 
<body class="easyui-layout">
<form id="excelSearch">
<div class="div_height_auto" data-options="region:'north',border:false" style="overflow: hidden;" align="left">
<table>
<tr height="30px;">
	<td align="right">纳税人识别号：</td><td><input type="text" name="search.regNumber" id="regNumber" style="width:100px;"/></td>
	<td align="right">企业名称：</td><td><input type="text" name="search.repDept" id="repDept"  style="width:100px;"/></td>
	<td align="right">举报形式：</td><td><ce:dictSelect id="repType" name="search.repType" dictName="检举台账管理-检查形式" allOption="true" style="width:100px;"/></td>
	<td align="right">举报日期：</td>
	<td><input type="text" name="search.beginRepDate" id="beginRepDate" style="width:80px;" class="Wdate" onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" readonly="true"/>&nbsp;至&nbsp;
	    <input type="text" name="search.endRepDate" id="endRepDate"  style="width:80px;"  class="Wdate" onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" readonly="true"/>
	</td>
	<td rowspan="3" valign="middle">
	   <a id="search" href="javascript:void(0)"  class="easyui-linkbutton" iconCls="icon-search">查询</a>
	   <a id="resetSearch" href="javascript:void(0)"  class="easyui-linkbutton" iconCls="icon-redo">重置</a>
	</td>
</tr>
<tr height="30px;">
	<td align="right">检举人：</td><td><input type="text" name="search.endRepDate" id="repPerson" style="width:100px;"/></td>
	<td align="right">检举人电话：</td><td><input type="text" name="search.repPersonPhone" id="repPersonPhone" name="repPersonPhone" style="width:100px;"/></td>
	<td align="right">处理方式：</td>
	<td> 
	   <select id="_dealWay" name="search._dealWay" style="width:100px;">
	     <option value="">-全部-</option>
	     <option value="1">快速处理</option>
	     <option value="2">移交市局</option>
	     <option value="3">转交其他部门</option>
	   </select>
	</td>
	<!-- 2015-06-09 by 修改，开始 -->
	<!-- 屏蔽搜索条件：结案日期，并调整表格 -->
	<td align="right">受理单位：</td><td><input type="text" name="search.regDept" id="regDept" style="width:100px;"/></td>
	<!-- 
	<td align="right">结案日期：</td>
	<td>
	    <input type="text" name="search.beginCloseDate" id="beginCloseDate" style="width:80px;" class="Wdate" onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" readonly="true"/>&nbsp;至&nbsp;
	    <input type="text" name="search.endCloseDate" id="endCloseDate" style="width:80px;" class="Wdate" onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" readonly="true"/>
	    
	</td>
	 -->
	<!-- 2015-06-09 by 修改，结束 -->
</tr>
<tr height="30px;">
	<td align="right">所属稽查局：</td><td>
	<select name="search.inspectDept" id="inspectDept" style="width:100px;">
	</select>
	</td>
	<td align="right">所属征管局：</td><td><select name="search.collectDept" id="collectDept" style="width:100px;"></select></td>
	<td align="right">是否受理：</td><td colspan="3"><s:select id="directorPassFlag"  name="search.directorPassFlag" style="width:100px"  list="#{'':'--全部--',0:'未处理',1:'已处理',2:'不予处理'}"></s:select></td>
</tr>
</table>
</div>
<div data-options="region:'center',border:false" style="overflow: hidden;">
  <table id="searchTable"></table>
</div>
</form>
</body>
</html>
   
   

